package data;

import java.sql.ResultSet;
import java.sql.SQLException;

public class MethodsEvents {
	public int method_id=0;
	public int event_id=0;
	
	public MethodsEvents(int _method_id,int _event_id){
		method_id = _method_id;
		event_id = _event_id;
	}
	
	public static MethodsEvents[] fromResultSet(ResultSet rs){
		try {
			rs.last();
			int count=rs.getRow();
			int index=0;
			MethodsEvents[] mes=new MethodsEvents[count];
			rs.beforeFirst();
			while(rs.next()){
				mes[index]=new MethodsEvents((Integer)rs.getObject(1),(Integer)rs.getObject(2));
				index++;
			}			
			return mes;
		}
		catch (SQLException e) {
			e.printStackTrace();
			return new MethodsEvents[0];
		}
		
	}
}
